/**
 * Copyright 2011 Joe Choi, All rights reserved.
 */
package tao.calendar.gregorian;

import tao.time.Time;

/**
 * The Operatable interface define the operation on date and time
 * 
 * @author Joe Choi
 * @version 1.0.0
 */
public interface Operatable {
	/**
	 * Add or subtract amount of time without affecting the value of higher level unit 
	 * (e.g. the higher level of minute is hour).
	 * if the result of operation is greater or less than the limit of specific time unit,
	 * the value of that unit will be modulo. 
	 * (e.g. if the result of operation of minute is 63, then the final value is 3)
	 */	
	public Operatable roll(GregorianUnitAmount amount);
	
	/**
	 * Add or subtract amount of time and the value of higher level unit will be adjusted
	 * if the value of lower level unit is overflow. that is, for example, if the result of
	 * operation of minute is 63, then the value of hour will add 1 unit and the minute is 
	 * set to 3. 
	 */
	public Operatable add(GregorianUnitAmount amount);
	
	/**
	 * Calculate the different of the time
	 */
	public GregorianAmount diff(Time other);
}
